﻿@model GameSchool.ViewModels.Exam.ListViewModel
@{
    ViewBag.Title = "Prófalisti fyrir: " + Model.currentCourse.Code + Model.currentCourse.Name + Model.currentCourse.Semester.Year + "-" + Model.currentCourse.Semester.SemesterOfYear;
}
<h2>
    Prófalisti fyrir @Model.currentCourse.Code, @Model.currentCourse.Name, @Model.currentCourse.Semester.Year-@Model.currentCourse.Semester.SemesterOfYear</h2>
@*@if (!string.IsNullOrEmpty(Model.userJustUpdated))
{
    <p>
        <span class="label label-info">Notandinn "@Server.HtmlEncode(Model.userJustUpdated)"
            var uppfærður</span>
    </p>
}
else if (!string.IsNullOrEmpty(Model.userJustCreated))
{
    <p>
        <span class="label label-info">Notandinn "@Server.HtmlEncode(Model.userJustCreated)"
            var búinn til</span>
    </p>
}
else if (!string.IsNullOrEmpty(Model.userJustChangedPassword))
{
    <p>
        <span class="label label-info">Lykilorðið hefur verið uppfært fyrir notandann "@Server.HtmlEncode(Model.userJustChangedPassword)"</span>
    </p>
}
*@<table class="table table-striped">
    <tr>
        <th>
            Heiti
        </th>
        <th>
            Einkunn
        </th>
        <th>
            Áunnin stig
        </th>
        <th>
            Rank
        </th>
        <th>
        </th>
    </tr>
    @foreach (var item in Model.examsStudent)
    {
        <tr>
            <td>
                @if (item.Grade.HasValue)
                {
                    @Html.ActionLink(item.Name, "Details", new { id = item.ExamHistoryID  })
                }
                else
                {
                    @Html.ActionLink(item.Name, "SubmitAnswers", new { id = item.ExamID })
                }
            </td>
            <td>
                @string.Format("{0:0.0}", item.Grade)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.EarnedPoints)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Rank)
            </td>
            <td>
                @if (item.Grade.HasValue)
                {
                    @Html.ActionLink("Niðurstöður", "Details", new { id = item.ExamHistoryID }, new { @class = "btn btn-mini" })
                }
                else
                {
                    @Html.ActionLink("Taka próf", "SubmitAnswers", new { id = item.ExamID }, new { @class = "btn btn-mini" })
                }
            </td>
        </tr>
    }
</table>
